package com.example;

import android.app.Activity;
import android.os.Bundle;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

public class MyActivity extends Activity {
    private LinearLayout nameContainer;
    private LinearLayout addressContainer;
    private LinearLayout parentContainer;

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        nameContainer = new LinearLayout(this);
        nameContainer.setLayoutParams(
                new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));

        TextView lblName = new TextView(this);
        lblName.setText("Name : ");
        TextView txtName = new TextView(this);
        txtName.setText("İlker Çelik");

        nameContainer.addView(lblName);
        nameContainer.addView(txtName);

        addressContainer = new LinearLayout(this);
        addressContainer.setLayoutParams(
                new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));

        addressContainer.setOrientation(LinearLayout.VERTICAL);
        TextView addrLbl = new TextView(this);
        addrLbl.setText("Address:");
        TextView addrValue = new TextView(this);
        addrValue.setText("911 Hollywood Blvd");

        addressContainer.addView(addrLbl);
        addressContainer.addView(addrValue);

        parentContainer = new LinearLayout(this);
        parentContainer.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,
                ViewGroup.LayoutParams.FILL_PARENT));
        parentContainer.setOrientation(LinearLayout.VERTICAL);
        parentContainer.addView(nameContainer);
        parentContainer.addView(addressContainer);

        setContentView(parentContainer);

    }
}